package testUnitaire;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import modele.Carte;
import modele.Region;

import org.junit.Test;

import codebase.IPartie;

public class CarteTest {

	private Carte m = Carte.carte;

	@Test
	public void testRegionExist1() {
		String s = "ESP";
		assertTrue(IPartie.carte.regionExist(s));
	}

	@Test
	public void testRegionExist2() {
		String s = "MAR";
		assertTrue(IPartie.carte.regionExist(s));
	}

	@Test
	public void testRegionExist3() {
		String s = "TRT";
		assertFalse(IPartie.carte.regionExist(s));
	}

	@Test
	public void testRegionExist4() {
		String s = "NAP";
		assertTrue(IPartie.carte.regionExist(s));
	}

	@Test
	public void testGetRegion1() {
		String s = "POR";
		assertNotNull(IPartie.carte.getRegion(s));
	}

	@Test
	public void testGetRegion2() {
		String s = "bud";
		assertNotNull(IPartie.carte.getRegion(s));
	}

	@Test
	public void testIsFrontalier1() {
		Region r1 = IPartie.carte.getRegion("por");
		Region r2 = IPartie.carte.getRegion("esp");
		assertTrue(r1.isFrontalier(r2));
	}

	@Test
	public void testIsFrontalier2() {
		Region r1 = IPartie.carte.getRegion("stp");
		Region r2 = IPartie.carte.getRegion("mos");
		assertTrue(r1.isFrontalier(r2));
	}

	@Test
	public void testIsFrontalier3() {
		Region r1 = IPartie.carte.getRegion("AtM");
		Region r2 = IPartie.carte.getRegion("ATn");
		assertTrue(r1.isFrontalier(r2));
	}

	@Test
	public void testIsFrontalier4() {
		Region r1 = IPartie.carte.getRegion("pru");
		Region r2 = IPartie.carte.getRegion("bou");
		assertFalse(r1.isFrontalier(r2));
	}

}
